From 12b46f84bf6af160db9ae14494657898a1c0f3e5 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Tue, 29 Jan 2008 14:12:08 +0000 Subject: [PATCH] Move the about dialog to the glade file, add accessible tags examples to 2008-01-29 Johan Dahlin * demos/gtk-demo/builder.c: (quit_activate), (about_activate), (do_builder): * demos/gtk-demo/demo.ui: Move the about dialog to the glade file, add accessible tags examples to the markup file. svn path=/trunk/; revision=19426 --- ChangeLog | 8 ++++++++ demos/gtk-demo/builder.c | 13 ++++++++----- demos/gtk-demo/demo.ui | 32 +++++++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9749f70d80..cbe0fb39b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-29 Johan Dahlin,,, + + * demos/gtk-demo/builder.c: (quit_activate), (about_activate), + (do_builder): + * demos/gtk-demo/demo.ui: + Move the about dialog to the glade file, add accessible tags + examples to the markup file. + 2008-01-28 Paolo Borelli * gtk/gtkprintunixdialog.c (draw_page_cb): do not leak the pango diff --git a/demos/gtk-demo/builder.c b/demos/gtk-demo/builder.c index 8ffa6c4603..f62985a617 100644 --- a/demos/gtk-demo/builder.c +++ b/demos/gtk-demo/builder.c @@ -6,9 +6,15 @@ #include #include "demo-common.h" +static GtkBuilder *builder; + void quit_activate (GtkAction *action) { + GtkWidget *window; + + window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); + gtk_widget_destroy (window); } void @@ -16,18 +22,15 @@ about_activate (GtkAction *action) { GtkWidget *about_dlg; - about_dlg = gtk_about_dialog_new (); - gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (about_dlg), - "GtkBuilder demo"); + about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1")); gtk_dialog_run (GTK_DIALOG (about_dlg)); - gtk_widget_destroy (about_dlg); + gtk_widget_hide (about_dlg); } GtkWidget * do_builder (GtkWidget *do_widget) { static GtkWidget *window = NULL; - GtkBuilder *builder; GError *err = NULL; gchar *filename; diff --git a/demos/gtk-demo/demo.ui b/demos/gtk-demo/demo.ui index a877223f0d..9d27c85cea 100644 --- a/demos/gtk-demo/demo.ui +++ b/demos/gtk-demo/demo.ui @@ -141,18 +141,28 @@ - + + GtkBuilder demo + + + + 250 440 - builder + GtkBuilder demo True True - + + + The menubar + + + False @@ -160,6 +170,11 @@ True + + + The toolbar + + False @@ -177,6 +192,14 @@ True liststore1 3 + + + Name list + + A list of person with name, surname and age columns + + + Name @@ -212,6 +235,9 @@ + + + 2 -- 2.30.2